<template>
  <div class="hello">
    vuex的使用学习
    <br>
    一个vuex {{$store.state.data}}
    <br>
    <button @click="add(2)">增加</button>传递参数
    <button @click="reduce">减少</button>
    <br>
    <router-link to="/count">多个vuex,跳转count</router-link>
    <router-link to="/money">多个vuex,跳转money</router-link>
  </div>
</template>

<script>
  import {mapActions} from 'vuex'
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  },
  methods:mapActions(['add','reduce'])
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
